ProbNcK_Given_PassFailSet <- function(N,K,P)
  
  # DOESN'T CURRENTLY DO ANYTHING!!!
  
# The recursive equation to be used is:
# #(NcKcP) * Pp^#P * ~Pc * Pul * Pfp * ~Pe^(N-X)
# #(NcKcP) * Pp^#P * ~Pc * Pe^X * ~Pe^(N-X)
# #(NcKcP) * P(Parents ~Fail)^(#P) * P(Component Fails) * P(Else)^(K-(#P+1))*~P(Else)^(N-(K-(#P+1)))
# I assume all the probabilities are that they'll survive.

KmX = max(k-(P+1),1)
NmX = max(N-(P+1),N)
NmKmX = N-KmX
NcKcP = choose(NmX,KmX)
NcK   = choose(N,k)                    # N-choose-K
#       numPp = numParents                      # Repeated for equation visual symmetry
avgPp = mean(PartProbs[compParentIdx]) # Parent Average Probability
Pc    = PartProbs[c]                   # Component Probability
elseIdx = !logical(N)      #
elseIdx[c(compParentIdx,c)] = FALSE    # Index of everything besides Component & Parents
numPe = sum(elseIdx)                   # Numober of others (Necessary??)
avgPe = mean(PartProbs[elseIdx])       # Everyone else's Average Probability

# Combine everything.
PeNKX = (1-avgPe)^KmX * avgPe^NmKmX # Probability of everything else in K-P
probCompReplaced[c,k] = NcKcP * avgPp^P * (1-Pc) * PeNKX
probNotReplaced[c,k]  = (NcK-NcKcP) * (1-avgPp)^P * Pc *PeNKX
eachK_ProbReplaced[c,k] = probCompReplaced[c,k] * probNotReplaced[c,k]